<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<!-- INCLUDE meta.html -->
</head>
<body>
<script>
try{ document.execCommand("BackgroundImageCache",false,true);}catch(e){ }
</script>
<div id='main'>
<?php
$all_cats = get_cats('all_categories');
?>
<div id="header">
	<h1 class="logo">
		<a href="./" title="Return to Homepage">
			<img src="{VIEW_ROOT}images/logo.gif" />
		</a>
	</h1>
	
	<div class="info">
		<a href="?cart">Shopping Cart</a>
		{if($_SESSION['user'])}
		<a href="?account">My Account</a> 
		<a href="?logout">Sign out</a>
		{else}
		<a href="?register">Register</a> 
		<a href="?login">Sign in</a> 
		{/if}
	</div>
	
	<div class="navi">
		<div class="bg-left"></div>
		<div class="bg-middle">
			{foreach(get_items('navi') as $c)}
				<a href="{$c['url']}" target="{$c['target']}" {if(strpos('?'.$_SERVER['QUERY_STRING'],$c['url']) !== false || (!$_SERVER['QUERY_STRING'] && $c['url'] == './' ))}class="hover"{/if} >
				<div class="left"></div>
				<div class="text">{$c['name']}</div>
				<div class="right"></div>
			</a>
			{/foreach}
		</div>
		<div class="bg-right"></div>
	</div>
	
	<div class="search">
		<div class="form">
			<form action="./" method="get" onsubmit="return $(this).find('[name=q]').val() != '';">
				<input type="hidden" name="p" value="search" />
				<input type="text" placeholder="Search for products..." class="text" name="q" /> 
				<select name="cid">
					<option value="">All Categories</option>
				{foreach($all_cats as $c)}
					<option value="{$c['category_id']}">{$c['name']}</option>
				{/foreach}
				</select> 
				<input type="image" src="{VIEW_ROOT}images/search-bt.gif" />
				<div class="clear"></div>
			</form>
		</div>
		<div class="hots">
			{foreach(get_items('brands') as $index=>$b)}
				{if($index > 0)} | {/if}
				<a href="{$b['url']}" target="{$b['target']}">{$b['name']}</a>
			{/foreach}
		</div>
	</div>
</div>